-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix <em>
issue with mixed content #1410
#1451
Conversation
ran wrong test command |
Wait, is it expecting a bug to be there? If it is, I seemed to have fixed it. |
Ya the spec tests that are currently failing will fail if they start passing. You will need to remove It looks like you are also failing some tests that used to pass. |
The |
ok I figured out why they are different. It was to prevent it from being interpreted as an ordered List. Also the underscore group has a bug: https://marked.js.org/demo/?text=_%3Cimg%20src%3D%22https%3A%2F%2Fwww.google.com%2Ffavicon.ico%22%20title%3D%22*_%22%2F%3E%0A%0A*%3Cimg%20src%3D%22https%3A%2F%2Fwww.google.com%2Ffavicon.ico%22%20title%3D%22*%22%2F%3E&options=&version=master The asterisk was processed correctly. While the underscore was not. So the bug was transferred over. So the underscore and asterisk groups need to be rewritten. |
Ok I think, I fixed it this time. |
@davisjam could you check if these regexps are secure from redos? Here are the new and old derived regexps for New:/^_([^\s_])_(?!_)|^\*([^\s*<\[])\*(?!\*)|^_([^\s<][\s\S]*?[^\s_])_(?!_|[^\s!"#$%&'()*+,\-.\/:;<=>?@\[^_{|}~])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\s!"#$%&'()*+,\-.\/:;<=>?@\[^_{|}~])|^\*([^\s<"][\s\S]*?[^\s\*])\*(?!\*|[^\s!"#$%&'()*+,\-.\/:;<=>?@\[^_{|}~])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/ Old:/^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s][\s\S]*?[^\s_])_(?!_|[^\s!"#$%&'()*+,\-.\/:;<=>?@\[^_{|}~])|^_([^\s_][\s\S]*?[^\s])_(?!_|[^\s!"#$%&'()*+,\-.\/:;<=>?@\[^_{|}~])|^\*([^\s"<\[][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/ |
@x13machine could you rebase this so we could get it merged? |
Ok I'll do that today |
How do I fix the errors? 😕 |
looks like example 455 should be Also move the new test files to |
I'm not sure why the latest commit didn't trigger travis to run the tests, but I ran it locally and everything passed. |
This still doesn't fix |
Marked version:
Markdown flavor: Markdown.pl|CommonMark|GitHub Flavored Markdown|n/a
Description
It was caused
_
and*
parsed being differently in the em regex. I just replaced the part that searches for*test*
and replaced it with the part searches for_test_
and then just charged the characters. I don't know why they were different. Maybe there's a reason for it. All the tests pass, so I dunno.Contributor
Committer
In most cases, this should be a different person than the contributor.